package com.jzx.provider;

import com.jzx.provider.cv.utils.IdWorker;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author: daihuihui
 * @date: 2018/11/9
 */
@SpringBootApplication
@EnableTransactionManagement
public class ProviderApplication {

    @Value("${workId}")
    private Integer workId;


    @Bean
    public IdWorker idWorker() {
        return new IdWorker(workId, 1, 1);
    }

    public static void main(String[] args){
        //解决netty冲突
        System.setProperty("es.set.netty.runtime.available.processors", "false");
        SpringApplication.run(ProviderApplication.class,args);
    }
}
